Les Smith .NET Blog
I just posted a rather lengthy article on extending the functionality of the CodeModel or better yet, the FileCodeModel. In spite of the functionality that it has, it still lacks functionality and this article shows some neat tricks for finding and retrieveing code that the CodeModel cannot do.
I think you will find some help here, if you are interested in the CodeModel, Regexes, and extensibility in general. Hope you like it.
The link is
http://www.knowdotnet.com/articles/extendingthecodemodel.html
Take a look.